#if !defined(AFX_UEMENUDLG_H__3BFAFB61_5BF7_47E0_9CB9_185FA2CCFB1D__INCLUDED_)
#define AFX_UEMENUDLG_H__3BFAFB61_5BF7_47E0_9CB9_185FA2CCFB1D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// uemenudlg.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// UeMenuDlg dialog

#include "MenuStyleRes.h"
#include "XTMenuBar.h"
#include "AutoCADMenu.h"
#include <vector>
#include <map>
#include "UeDockControlBar.h"
#include "SmartPointer.h"

using namespace UEPHSMENU;

#define ID_MENU_BGN                0xB001
#define ID_MENU_END                0xB999

typedef pair <UINT, CString> Command_Pair;
void SendCommandToAutoCAD(CString cmd);
class UeMenuDlg : public CDialog
{
// Construction
public:
	UESoft::ErrorStatus HideMenu(const CStringArray &theGroups = CStringArray());
	UESoft::ErrorStatus UeMenuDlg::ShowMenu(const CStringArray& theGroups = CStringArray());
	UeMenuDlg(AutoCADMenu * pCADMenu,CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(UeMenuDlg)
	enum { IDD = IDD_MENU_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(UeMenuDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(UeMenuDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnDestroy();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnMenuClicked(UINT nID);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	void UnloadMenu();
	BOOL LoadSubMenu(HMENU hMenu,UEPHSMENU::PopMenu *pPMenu,int& nCount);
	BOOL LoadSubMenu(HMENU hMenu,UEPHSMENU::MenuItem * pMItem,int& nCount);
	void ShowAll();

	CXTMenuBar m_wndMenuBar;
	CMenu m_MainMenu;
	AutoCADMenu* m_pCADMenu;
	std::map <UINT,CString > m_MapCmd;
	std::vector<CMenu*> m_vecMenus;
	CPtrList m_listControlBars;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_UEMENUDLG_H__3BFAFB61_5BF7_47E0_9CB9_185FA2CCFB1D__INCLUDED_)
